﻿@model ITProject.WebUI.Models.ProjectAdmin.ProjectAdminEditFeatureViewModel
@{
    ViewBag.Title = "Edycja funkcjonalności";
    Layout = "~/Views/Shared/_Layout.cshtml";
}


@using ITProject.WebUI.Models.ProjectAdmin
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<h2>Panel administracyjny projektu @Model.ProjectName</h2>


<div class="Pmenu">
@Html.Partial(MVC.Shared.Views.Partials._ProjectMenuControl,
new ITProject.WebUI.Models.Project.ProjectMenuViewModel { ProjectName = Model.ProjectName, Role = ITProject.Domain.UserRole.Supervisor })
</div>


<div class="PAmenu">
@Html.Partial(MVC.Shared.Views.Partials._ProjectAdminMenu, new List<string> { "F", Model.ProjectName })
@*@Html.ActionLink("Zarządzaj użytkownikami",MVC.ProjectAdmin.ActionNames.ManageTeam, MVC.ProjectAdmin.Name, new { projectName = Model }, null)*@
</div>
<div class="PAplane">

@using (Html.BeginForm(MVC.ProjectAdmin.ActionNames.EditFeature, MVC.ProjectAdmin.Name, FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(true)
    <fieldset>
        @Html.HiddenFor(model => model.ProjectName)
        @Html.HiddenFor(model => model.FeatureId)

        <legend>Edycja funkcjonalności</legend>
        <div class="editor">
            <div class="editor-label">
                @Html.LabelFor(model => model.Name) <span class="validation">*</span>
            </div>
            <div class="editor-field">
            <p class="validation">@Html.ValidationMessageFor(model => model.Name)
</p>
                @Html.TextBoxFor(model => model.Name, new { @class = "input" })
                
            </div>
        </div>
        <div class="editor">
            <div class="editor-label">
                @Html.LabelFor(model => model.Description)
            </div>
            <div class="editor-field">
                @Html.TextAreaFor(model => model.Description, new { @class = "input" })
                @Html.ValidationMessageFor(model => model.Description)
            </div>
        </div>
        <div class="editor">
            <div class="editor-label">
                @Html.LabelFor(model => model.PlannedEndDate)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(model => model.PlannedEndDate, new { @class = "cal", @Value = Model.PlannedEndDate.ToString("yyyy/MM/dd") })
                @Html.ValidationMessageFor(model => model.PlannedEndDate)
            </div>
        </div>
        <div class="editor">
            <div class="editor-label">
                @Html.LabelFor(model => model.ReturnPriority)
            </div>
            <div class="editor-field">
            @Html.DropDownListFor(model => model.ReturnPriority, Model.PriorityList.Priorities, new { @class = "input" })
               @* @Html.DropDownListFor(model=>model.SelectProjectUser,Model.ProjectUsers, new { @class = "input" })*@
            </div>
        </div>
    
        <div class="editor">
            <div class="editor-label">
                @Html.LabelFor(model => model.ReturnVersion)
            </div>
            <div class="editor-field">
            @Html.DropDownListFor(model => model.ReturnVersion, Model.ReleaseList, new { @class = "input" })
               @* @Html.DropDownListFor(model=>model.SelectProjectUser,Model.ProjectUsers, new { @class = "input" })*@
            </div>
        </div>
        <div class="editor">
            <div class="editor-label">
                <br /> 
            </div>
            <div class="editor-field">
                @Html.RadioButtonFor(model => model.IsToUser, true, new { @class = "radio", @id = "radioU", @checked = "checked" }) <small> Przypisz do uzytkownika</small><br />
                @Html.RadioButtonFor(model => model.IsToUser, false, new { @class = "radio", @id = "radioT" }) <small>Przypisz do zespołu</small>
            </div>
        </div>
        @{
           string user;
           string team;
}
        @if (Model.IsToUser)
        {
            user = "display: table-row";
            team = "display: none";
        }
        else
        {
            user = "display: none";
            team = "display: table-row";

        }
          <div class="editor" id="SelectU" style="@user.ToString()">
            <div class="editor-label">
                @Html.LabelFor(model => model.ReturnUser) 
            </div>
            <div class="editor-field">
            @Html.DropDownListFor(model => model.ReturnUser, Model.UserList, new { @class = "input" })
               @* @Html.DropDownListFor(model=>model.SelectProjectUser,Model.ProjectUsers, new { @class = "input" })*@
            </div>
        </div>
                <div class="editor" id="SelectT" style="@team.ToString()">
            <div class="editor-label">
                @Html.LabelFor(model => model.ReturnTeam)
            </div>
            <div class="editor-field">
            @Html.DropDownListFor(model => model.ReturnTeam, Model.TeamList, new { @class = "input" })
               @* @Html.DropDownListFor(model=>model.SelectProjectUser,Model.ProjectUsers, new { @class = "input" })*@
            </div>
        </div>
        <p class="validation" style="padding-left:50px">        
        *pola wymagane
        </p>
        <div class="DSubmit">
        <p>
            <input type="submit" value="Zapisz" class="button"/>
        </p>
        </div>
    </fieldset>
}

</div>
<div class="clear">
</div>






